<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>lesson7</title>

    <!-- Bootstrap -->
    <link href="/app/bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body ng-app="app">
    <div class="container" ng-controller="MainCtrl as main">
      <h1>A JWT Tutorial</h1> 
      <hr>
      <form name="userForm" novalidate>
        <input type="text" class="form-control" name="mobile"  ng-model="main.mobile" required placeholder="手机号">
        <div class="input-group">
          <input type="text" class="form-control" name="captcha" ng-model="main.captcha" placeholder="验证码">
          <span class="input-group-btn">
            <button class="btn btn-default" ng-click="main.getCaptcha()" ng-disabled="main.captchaBtnDisabled">
              {{main.captchaBtn}}
            </button>
          </span>
        </div>
      </form>
      <hr>
      <button class="btn btn-default" ng-click="main.register()" ng-show="!main.isAuthed()">注册</button>
      <button class="btn btn-default" ng-click="main.login()" ng-show="!main.isAuthed()">登录</button>
      <button class="btn btn-default" ng-click="main.logout()" ng-show="main.isAuthed()">登出</button>
      <button class="btn btn-default" ng-click="main.testToken()" ng-show="main.isAuthed()">测试</button>
      <hr>
      {{main.message}}
    </div>
    <script src="/app/bower_components/angular/angular.min.js"></script>
    <script src="js/app.js"></script>

    <!-- <script src="/lesson2/js/services.js"></script> -->
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="/app/bower_components/jquery/dist/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="/app/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  </body>
</html>